package com.kabuda.blog.handler;

import com.kabuda.blog.vo.Result;
import org.springframework.web.bind.annotation.*;

/**
 * @author kabuda
 * @create 2023-01-16 17:57
 */
@ControllerAdvice
@ResponseBody  //返回数据，而非页面
//@RestControllerAdvice
public class AllExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result AllException(Exception e){
        e.printStackTrace();
        return Result.fail(999,"系统异常");
    }
}
